/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.web.gwt.basics.context;

import com.genia.toolbox.web.context.WebContext;
import com.genia.toolbox.web.gwt.basics.bean.FileInformation;

/**
 * the context used by this application.
 */
public interface GwtBasicsContext
    extends WebContext
{

  /**
   * set the upload progress of the file identified by its identifier.
   * 
   * @param identifier
   *          the identifier of the file being uploaded
   * @param progess
   *          the progress of the upload between 0 and 100
   */
  public abstract void setProgress(Long identifier, int progess);



  /**
   * return the upload progress of the file identified by its identifier.
   * 
   * @param identifier
   *          the identifier of the file being uploaded
   * @return the progress of the upload between 0 and 100
   */
  public abstract Integer getProgress(Long identifier);



  /**
   * set the {@link FileInformation} of the file identified by its identifier.
   * 
   * @param fileInformation
   *          the information relative to the file
   */
  public abstract void setFileInformation(FileInformation fileInformation);



  /**
   * returns the {@link FileInformation} of the file identified by its
   * identifier.
   * 
   * @param identifier
   *          the identifier of the file being uploaded
   * @return the information relative to the file
   */
  public abstract FileInformation getFileInformation(Long identifier);



  /**
   * retrieve the session identifier of a {@link FileInformation} by its
   * permanent identifier.
   * 
   * @param permanentIdentifier
   *          the permanent identifier of the {@link FileInformation}.
   * @return the session identifier of a {@link FileInformation} by its
   *         permanent identifier
   */
  public abstract Long getSessionIdentifierForPermanentIdentifier(Long permanentIdentifier);
}
